package com.wunong.smart.collection.service;

import com.wunong.smart.collection.application.request.CancelCollectionRequest;
import com.wunong.smart.collection.application.request.CollectRequest;
import com.wunong.smart.collection.client.param.CancelCollectionParam;
import com.wunong.smart.collection.client.param.CollectParam;
import com.wunong.smart.collection.client.service.CollectionOperateService;
import com.wunong.smart.collection.domain.service.CollectionDomainService;
import com.wunong.smart.domain.platform.rpc.Result;

import javax.annotation.Resource;

/**
 * @author create by zealot.zt
 */
public class CollectionOperateServiceImpl implements CollectionOperateService {

    @Resource
    protected CollectionDomainService collectionDomainService;

    @Override
    public Result<Long> collect(CollectParam param) {
        return Result.create(collectionDomainService.collect(CollectRequest.of(param)));
    }

    @Override
    public Result<Void> cancel(CancelCollectionParam param) {
        return Result.create(collectionDomainService.cancel(CancelCollectionRequest.of(param)));
    }

}
